package org.wlw.service;

import org.wlw.anno.Resource;
import org.wlw.dao.IMovieDao;
import org.wlw.models.Movie;

import java.util.List;

public class MovieService extends BaseService implements IMovieService{

    private IMovieDao movieDao;

    @Resource
    public void setMovieDao(IMovieDao movieDao) {
        this.movieDao = movieDao;
    }

    @Override
    public void add(Movie movie) {
        movieDao.add(movie);
    }

    @Override
    public void delete(int id) {
        movieDao.delete(id);
    }

    @Override
    public void update(Movie movie) {
        movieDao.update(movie);
    }

    @Override
    public Movie load(int id) {
        return movieDao.load(id);
    }

    @Override
    public List<Movie> list() {
        return movieDao.find();
    }
}
